//
//  WCFile.h
//  WabbitCode
//
//  Created by William Towe on 1/22/09.
//  Copyright 2009 Revolution Software. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "WCTreeNode.h"


@class WCFileReference, WCProject;

@interface WCFile : WCTreeNode <NSCoding, NSCopying> {
	// reference to the file we are representing
	WCFileReference *_fileReference;
	// reference to our containing project, not retained
	WCProject *_project;
	// cached absolute file path
	NSString *_absoluteFilePath;
	
	// saved frame for the get info window for this file
	NSRect _getInfoWindowFrame;
	
	struct __WCFileFlags {
		unsigned int recacheAbsoluteFilePath:1;
		unsigned int reserved:31;
		
	} _WCFileFlags;
}
@property (readwrite, retain) WCFileReference *fileReference;
@property (readwrite, assign) WCProject *project;
@property (readwrite, copy) NSString *absoluteFilePath;
@property (readonly) NSString *absoluteFilePathByAbbreviatingTildeInPath;
@property (readonly) NSString *folderPath;
@property (readonly) NSString *fileUTI;
@property (readonly) NSNumber *numberOfFileErrors;
@property (readonly) NSNumber *numberOfFileWarnings;
@property (readonly) NSString *fileExtension;
@property (readonly) NSImage *fileIcon;
@property (readwrite, assign) NSRect getInfoWindowFrame;
@property (readwrite, assign) BOOL recacheAbsoluteFilePath;

+ (id)fileWithFilePath:(NSString *)filePath inProject:(WCProject *)project;
+ (id)fileWithFilePath:(NSString *)filePath name:(NSString *)name inProject:(WCProject *)project;

- (id)initWithFilePath:(NSString *)filePath inProject:(WCProject *)project;
- (id)initWithFilePath:(NSString *)filePath name:(NSString *)name inProject:(WCProject *)project;
@end
